* lilu-debugger: debugging utilities

** Usage
*** Debugging
To install the debugger hook:
#+BEGIN_SRC lisp
(enable-debugger)
#+END_SRC
To ensure it is installed globally:
#+BEGIN_SRC lisp
(enable-debugger :force-global-p t)
#+END_SRC
To uninstall it
#+BEGIN_SRC lisp
(disable-debugger)
;; (disable-debugger :force-global-p t)
#+END_SRC

To activate a debugger (e.g. emacs):
#+BEGIN_SRC lisp
(setf (active-debugger) :emacs)
#+END_SRC

To get the list of installed debuggers:
#+BEGIN_SRC lisp
(registered-debuggers)
#+END_SRC

To get the active debugger:
#+BEGIN_SRC lisp
(active-debugger)
#+END_SRC

To set a default-debugger (e.g. emacs):
#+BEGIN_SRC lisp
(setf *default-debugger* :emacs)
#+END_SRC

to use it:
#+BEGIN_SRC lisp
(setf (active-debugger) :default)
#+END_SRC
or:
#+BEGIN_SRC lisp
(setf (active-debugger) :dynamic) ;; it check *default-debugger* at every invocation
#+END_SRC

To use a degugger locally (e.g. emacs):
#+BEGIN_SRC lisp
(with-debugger (:emacs)
  ...
  )
#+END_SRC

To ignore condition (inside with-debugger):
#+BEGIN_SRC lisp
(with-debugger (:emacs)
  ...
  (ignore-conditions
    ...
    )
  ...
  )
#+END_SRC
*** Breaking
To install the debugger hook for the break function:
#+BEGIN_SRC lisp
(enable-break)
#+END_SRC
To ensure it is installed globally:
#+BEGIN_SRC lisp
(enable-break :force-global-p t)
#+END_SRC
To uninstall it
#+BEGIN_SRC lisp
(disable-break)
;; (disable-debugger :force-global-p t)
#+END_SRC

To activate a specific debugger for break (e.g. emacs):
#+BEGIN_SRC lisp
(setf (active-break-debugger) :emacs)
#+END_SRC

To set *break-on-signals*:
#+BEGIN_SRC lisp
(with-break-on-signals (:emacs)
  ...
  )
#+END_SRC

or:
#+BEGIN_SRC lisp
(with-debugger (:emacs 'warn)
  ...
  )
#+END_SRC

** Installation
Clone the project into local-projects of quicklisp, then

#+BEGIN_SRC lisp
(ql:quickload :lilu-debugger)
#+END_SRC

Load different debugger implementation:

#+BEGIN_SRC lisp
(ql:quickload :lilu-debugger/emacs) ;; require lilu-emacs
(ql:quickload :lilu-debugger/clim)  ;; require mcclim
(ql:quickload :lilu-debugger/dmenu) ;; require lilu-dmenu
#+END_SRC

** Implemented Debuggers

| Name     | What                                       | Requires   | Quicklisp |
|----------+--------------------------------------------+------------+-----------|
| :none    | do nothing                                 |            | s         |
| :abort   | always invoke abort restart                |            |           |
| :quit    | always exit from common lisp               |            |           |
| :default | see *defaul-debugger*                      |            |           |
| :dynamic | see *default-debugger* at every invocation |            |           |
| :emacs   | open emacs and run its debugger            | lilu-emacs | No        |
| :lem     | open lem and run its debugger              | mcclim     | Yes       |
| :clim    |                                            | lilu-lem   | No        |
| :dmenu   | use dmenu to select a debugger             | lilu-dmenu | No        |

** Author
+ Alessandro Serra (gas2serra@gmail.com)
** Copyright
Copyright (c) 2021 Alessandro Serra (gas2serra@gmail.com)
** License
Creative Commons CC0 1.0 Universal
